The Islamic calendar is a physical lunar calendar. That implies that any computer algorithm only approximates the true calendar. Therefore, going far into the past or the future is even less meaningful than for the mathematical calendars. Nevertheless, InterCal forges ahead!
In the true Islamic calendar, months start at the first official sighting of the new moon. Since it takes one to two days for a new moon to be visible after astronomical new moon. Islamic months are offset by a day or two from astronomical new moon. Note that this calendar is purely lunar, and makes no attempt at all to track the sun. Therefore the months cycle quickly through the seasons—it only takes 33 years for Ramadan (as an example) to cycle from a spring month all around the year and back to spring again.
The formulas used by InterCal (described below) are approximations to the Islamic calendar. I believe this system is in common use throughout most of the Islamic world for planning purposes.
The rules of the mathematical approximation to the Islamic calendar as implemented by InterCal are:
1) The negative year era is labeled B.H. (Before the Hegira). The positive year era is labeled A.H. (Anno Hegira, Year of the Hegira).
2) Months are named (in order) Muharram, Safar, Rabi‘ al-Awwal, Rabi‘ al-Akhir, Jumada’ al-Ula, Jumada’ al-Akhirah, Rajab, Sha’baan, Ramadan, Shawwal, Dhul-Qi’dah, Dhul-Hijjah. Years start in Muharram.
3) Days begin at sunset. The convention used for displaying days is the same as that used for the Jewish calendar, whose days also start at sunset. The Julian Day of midnight during Muharram 1, 1 A.H. Islamic (a Friday) is 1948439.5.
4) Muharram, Rabi‘ al-Awwal, Jumada’ al-Ula, Rajab, Ramadan, and DhulQi’dah have 30 days.
5) Safar, Rabi‘ al-Akhir, Jumada’ al-Akhirah, Sha’baan, and Shawwal have 29 days.
6) Dhul-Hijjah has 29 days in normal years and 30 days in leap years.
7) The leap year cycle is thirty years long. One cycle began in the year 1 A.H. and ended in 30 A.H. Year #1 in the preceding cycle was 30 B.H. and year #30 in that cycle was 1 B.H. Leap years occur in years whose position in their cycle is 2, 5, 7, 10, 13, 16, 18, 21, 24, 26, or 29.
With a leap year cycle of thirty years containing 354(30) + 11 days and 360 months, the average month is 29.53055556 days, for an error of 0.00003264 days per month, or approximately one day every 2500 years. The months are slightly too short. This approximation to the Islamic calendar has about the same error with respect to the moon that the Gregorian calendar has with respect to the sun. Remember that the official Islamic calendar is based on observations of the real moon, and so by definition has no perceptible error. Because the approximation’s months are too short, the first of each month computed by InterCal will come earlier and earlier compared to the actual start of the month as the millennia go by.
Elliott Super Calendar
The Elliott Super Calendar was invented as a toy by the author of InterCal. It is a mathematical luni-solar calendar. The eras are imaginatively named B.Z. and A.Z. for Before Zero and After Zero.
Just for fun, I decided to find a common multiple of the tropical year and the synodic month which was considerably closer than the 19-year (235-month) Metonic cycle discovered by the Babylonians and used in several other calendars (including the Jewish). I wanted accuracy, but did not want ridiculously long cycles of tens or hundreds of thousands of years. Although such long cycles might produce even greater accuracy, they would be unnecessarily complicated and not worthwhile in view of the long-term instability of the sun and moon’s motions. I found a very nice match with a 1689-year cycle containing 20890 months. This is only about four times as long as the Gregorian cycle, yet produces considerably greater accuracy for the sun and throws in the moon as well!
The Elliott Super Calendar uses astronomical new moon in its calculations. That is, it uses as definition of new moon the time at which the earth, moon, and sun are most nearly aligned in a straight line. The Jewish calendar evolved from a system in which actual sightings of a new crescent moon began each month. And the Islamic calendar continues to use such sightings for its official definition. Since a new crescent takes one or two days to become visible after astronomical new moon, the starts of months in the Jewish and Islamic calendars tend to be offset from those in the Elliott calendar by one or two days.
Taking a lesson from the Caesars, I named the first month after myself. Then I bested them by naming all the other months after my wife, children, parents, sisters, and my wife’s parents and siblings.
For the zero point, I tried to find a place not too far away from the zero point of the Gregorian calendar. I also had two other criteria. For some year near the zero point I wanted new moon to occur very close to midnight at the start of the first day of the year. I also wanted the average date of the vernal equinox to be the first day of the year. (This rule was often used in ancient calendars, including the Babylonian and the Roman systems which pre-dated the Julian.) These considerations led to the following rules.
1) The negative year era is labeled B.Z. (Before Zero). The positive year era is labeled A.Z. (After Zero).
2) Months are named (in order) Denis, Jill, Nicole, Abigail, Ernest, Gladys, Gerard, Veronica, Anne, Colette, Joan, Ericka, and Anthony. Years start in Denis.
3) Normal years have 12 months (Denis through Ericka).
4) Leap years have 13 months (the month Anthony is added after Ericka).
5) Denis, Nicole, Ernest, Gerard, Anne, and Joan always have 30 days.
6) Jill, Abigail, Gladys, Veronica, Colette, and Ericka always have 29 days.
7) In leap years, the added month (Anthony) can have either 30 or 31 days. See Rules #8 and #10 below.
8) The leap year cycle is 1689 years long. One cycle began with 1 A.Z. and ended with 1689 A.Z. The cycle preceding that one began with 1689 B.Z. and ended with 1 B.Z. During each cycle there are three types of years. Normal years have 12 months. Leap Year Type 1 has the month Anthony added with Anthony having 30 days. Leap Year Type 2 has the month Anthony added with Anthony having 31 days. During each cycle there are 1067 normal years, 294 Type 1 leap years, and 328 Type 2 leap years. These leap years are distributed approximately evenly throughout the cycle.
9) The Julian Day of midnight at the start of Denis 1, 1 A.Z. Elliott (a Thursday) is 1751822.5. (This date corresponds to 25 March 84 A.D. Julian, which is 23 March 84 A.D. Gregorian.)
10) The rule for which years within each cycle are of which type is most easily understood in terms of a table. Such a table, having 1689 entries, would specify the type of each year. But such a table is too long for this document. So instead, I specify the rule for computing that table. That is exactly what InterCal does during initialization.
a) Define two auxiliary tables, Type2 (with 328 entries) and Type 1 (with 294). For each integer N from 1 to 328, set its entry in Type2 to the nearest integer to 1689N/328 (round, don’t truncate).
b) For each integer M from 1 to 294, set its entry in Type1 to the nearest integer to 1689M/294 - 3. (Round, don’t truncate.) (The purpose of the “3” is to offset entries in Type 1 from entries in Type2.) Occasionally during this process, the computed value of the M’th entry in Type1 will equal the (M-1)’th entry. Check for this, and when it happens go to the other table (Type2). Set the M’th entry of Type1 to the average of the two values in Type2 which are closest to, but both larger than, the duplicated value. When averaging, truncate to the next lowest integer if the average is not an integer.
c) Generate the final table, T1689, as follows:
i) For every integer J from 1 to 1689, set T1689(J) to “normal” unless J can be found in Type1 or Type2.
ii) If J is in Type1, set T1689(J) to “Leap Year Type 1”.
iii) If J is in Type2, set T1689(J) to “Leap Year Type 2”. If computed correctly, there are no duplicates between or within the auxiliary tables.
As samples, the first few entries in Type2 are 5, 10, 15, 21, 26, 31, 36, 41, 46, 51…
The first few entries in Type1 are 2, 7, 12, 18, 23, 28, 38, 43, 48, 54…
The rules above imply that there are exactly 616894 days in each 1689-year cycle. Thus the average length of a year is 365.2421551 days, so years are too short by 0.0000439 days, which amounts to an error of one day in 22780 years. This is nearly seven times as accurate as the Gregorian calendar and far more accurate than the Julian and Jewish calendars. The rules also imply that, on average, there are exactly 616894/20890 = 29.5305889 days per month. Thus the months are too long by 0.0000006 days. That is equivalent to an error of 0.012534 days per 1689-year cycle or 0.0000074 days per year. Thus, with respect to the moon, the Elliott calendar builds up an error of one day every 135000 years (approximately). This is ten times as accurate as the Jewish calendar, which (for the moon) is a very accurate calendar.
French Revolutionary Calendar
The French Revolutionary Calendar was instituted after the Revolutionaries achieved full control of France. It was the official calendar of France for a few years. In keeping with the passion of the Revolutionaries for rationality and naturalism, the calendar has every month the same length—30 days. The months are named for natural phenomena (mostly weather-related) such as Vintage, Hot, Rain, and Wind.
The French Revolutionary is a mathematical solar calendar. In fact, in spite of the renaming of months and offsetting of months and years, this calendar is based carefully on the Gregorian and is always kept synchronized with it. For that reason, its average year length and its accuracy with respect to the sun are exactly the same as for the Gregorian.
One oddity about the French Revolutionary calendar (especially considering who invented it) was that its years are specified in Roman numerals, not Arabic. InterCal takes the liberty of ignoring this, and states years in standard Arabic numerals as for all the other calendars. No era names appear to have been defined by the Revolutionaries. The era abbreviations used by InterCal are based on non-standardized but reasonably common usage of historians specializing in the period.
My thanks to Professor David Stewart of Hillsdale College for giving me the rules for this calendar.
The rules of the French Revolutionary calendar as implemented by InterCal, are:
1) The negative-year era is labeled A.R., for Ancien Régime. The positive-year era is labeled R.C. for Revolutionary Calendar.
2) Months are named, in order, Vendémiaire (Vintage), Brumaire (Fog), Frimaire (Sleet), Nivôse (Snow), Pluviôse (Rain), Ventôse (Wind), Germinal (Sprouting), Floréal (Flowering), Prairial (Pasturing), Messidor (Harvest), Thermidor (Hot), and Fructidor (Fruit). Years start in Vendémiaire.
3) The Julian Day of midnight at the start of Vendémiaire 1, 1 R.C. (a Saturday) is 2375839.5, which corresponds to September 22, 1792 A.D. Gregorian.
4) Every month has 30 days. Thus in most years Vendémiaire begins on September 22 in the Gregorian calendar; Brumiaire begins on October 22; Frimaire on November 21, etc. Fructidor normally began on August 18 and ended on September 16. The leap year rule (item 7 below) changes this fixed relationship slightly.
5) After the end of Fructidor there are five extra days (in normal years) called jours complémentaires. In leap years a sixth extra day was added. Technically, these extra days were not considered to belong to any month. They each had a special name:
a) Fête dès Vertus (The Virtues)—17 September Gregorian;
b) Fête du Génie (Genius)—18 September;
c) Fête du Travail (Labor)—19 September;
d) Fête de l’Opinion (Opinion)—20 September;
e) Fête dès Récompenses (Rewards)—21 September;
f) In French Revolutionary leap years, a sixth extra day was added, falling on September 22 and causing Vendémiaire 1 of the following year to be on September 23 Gregorian.
6) For implementation convenience, InterCal treats the jours complémentaires as a very short thirteenth month, containing five days in normal years and six in leap years. InterCal does not use the special names of the days, but simply numbers them.
7) The leap year cycle is four hundred years long, as in the Gregorian calendar. One cycle began in 1 R.C. and will end in 400 R.C. The preceding cycle began in 400 A.R. and ended in 1 A.R. French Revolutionary leap years are synchronized with Gregorian leap years as follows. French Revolutionary years which end in September of a year preceding a Gregorian leap year are French Revolutionary leap years (having the sixth extra day added). Thus French Revolutionary years which contain February 29 in the Gregorian calendar start one day late, but are not leap years. That is, Vendémiaire 1 corresponds to September 23 instead of the usual September 22. The months of Brumaire, Frimaire, Nivôse, Pluviôse, and Ventôse also start one day later than usual. February 29 Gregorian then falls on Ventôse 10, after which the French Revolutionary and Gregorian calendars are back in their usual synchronism. The fifth extra day at the end of such a year corresponds to September 21 Gregorian as always.
The above verbose and complicated rule reduces to the following strange-looking but concise mathematical rule: years whose position in their cycle equals 3 modulo 4 and does not equal 7 modulo 100, and year 207 in each cycle, are leap years.
Mayan Calendar(s)
The rules for the Mayan calendars have only been reconstructed within the past few decades. Much information is still unknown and is probably permanently lost. After the conquest, most (but not all) of the Spanish rulers either made a conscious effort to eradicate Mesoamerican culture or at least instituted policies which were antithetical to the preservation of their culture by the natives. The situation was probably made worse by the fact that, while Mayan people were still living in the area (and continue to do so today), the high pre-Columbian Mayan civilization had collapsed hundreds of years before the Spanish conquest. The Aztecs, on the other hand, were a thriving group as the Spanish arrived. Yet much knowledge about their culture has also been lost.
Much of the information in the rest of this section is summarized from two sources:
a paper by Reingold, Dershowitz, and Clamen in the journal Software—Practice and Experience, Volume 23 Number 4 (April 1993);
an article on Mayan astronomy by A. D. Jenkins which is available on the Internet at
http://clunix.msu.edu/~vanhoose/astro/0101.html
The Maya had an elaborate writing system which is still being deciphered. They were also good mathematicians and astronomers. They had a number system which was base 20, as opposed to our base 10. They had accurate knowledge of the length of the year and the length of the synodic month. They were able, perhaps crudely by modern standards, to predict eclipses. Their knowledge of the apparent motions of the planet Venus may have surpassed that of any contemporary culture in the world. Although they counted days within the lunar cycle, they did not attempt to make their major calendars (the three supported by InterCal) track astronomical objects accurately. They seemed (in my opinion) to be fascinated with exact periodicity and relationships between cycles of differing periods. Their calendars were elaborate day counting and cycle-marking systems which paid only slight attention to such things as lunar months and solar years. Perhaps this lack of emphasis on longer time units is related to the view, held by many Mesoamerican cultures, that the sun would not rise tomorrow unless the people propitiated the gods through certain mandatory rituals. Some of these rituals were very bloody and a few involved human sacrifice.
Three calendars used by the Maya are supported by InterCal. These are the Long Count, the Tzolkin cycle, and the Haab cycle. The Tzolkin and Haab cycles were often used together to make a much longer cycle known as the Calendar Round. This latter cycle is also supported by InterCal. The Long Count is a pure day counting system, just like the Julian Day Number. The Haab cycle is roughly based (and the Maya knew how roughly) on the sun. The Tzolkin cycle is roughly based on the planet Venus. Both cycles had considerable religious significance attached to the various day numbers and names.
The Long Count—InterCal-style
1) The Long Count was nothing more than a five-vigesimal-digit number which counted days, starting from 0 and increasing by one every day. (Vigesimal means “base 20”.) Note that only five digits were used. The Maya believed that when the value of the high-order vigesimal digit reached 13 the universe would be destroyed, a new universe created, and the Long Count would begin again at zero. Today, Long Count values are usually written as five decimal numbers separated by periods. Thus a typical Long Count date would be written as 12.9.0.14.19.
2) Each vigesimal digit in the Long Count can be in the range 0 through 19 inclusive, except for the second digit from the right, which was restricted to the range 0 through 17 inclusive. By making the second from the right digit base 18, a change of one in the third digit corresponded to a change in the value of the Long Count of 18*20 = 360, or roughly one year.
3) The time periods corresponding to a change of one in each digit had names as follows:
a) 1 kin = 1 day (right-most digit)
b) 1 uinal = 20 days (second digit from right)
c) 1 tun = 360 days (third digit from right)
d) 1 katun = 7200 days (fourth digit from right)—very roughly 20 years
e) 1 baktun = 144,000 days (fifth digit from right)—very roughly 400 years
4) InterCal is designed not to be limited by arbitrary time boundaries, but only by computer-related limitations on the sizes of integers. Therefore InterCal uses an 8-vigesimal-digit Long Count. Thus a typical Long Count is written 1.4.8.0.13.18.16.10, where the right-hand five vigesimal digits have their usual meanings. Admittedly, this rule ignores the Mayan belief in the destruction of the universe on 13.0.0.0.0. But the higher-order digits do not violate any rules of Mayan mathematics. In fact, the Maya even had words for longer time intervals which corresponded to higher-order digits as follows:
a) 1 pictun = 2,880,000 days (sixth digit from right)—very roughly 8000 years
b) 1 calabtun = 57,600,000 days (seventh digit from the right)
very roughly 160,000 years
c) 1 kinchiltun = 1,152,000,000 days (eight digit from right)
very roughly 3,200,000 years
The Maya also had a word for the time period which would have corresponded to a ninth digit. That word is alautun and equals 23,040,000,000 days or very roughly 64,000,000 years. But InterCal cannot use this ninth digit because 23,040,000,000 exceeds the largest integer which can fit into a 32-bit word.
To summarize, in InterCal the Long Count is written as 8 vegisimal digits, of which one (second from right) is actually base 18, not base 20.
5) InterCal allows the Long Count to be negative or zero. A negative Long Count is written exactly like any other, but the first digit is preceded by a minus sign. Thus a possible Long Count date in InterCal is -0.0.0.8.13.11.1.18.
6) The zero point of the Long Count is one piece of knowledge which has been lost. That is, no one knows what Julian Day number corresponds to a Long Count of 0.0.0.0.0 (or, in InterCal, 0.0.0.0.0.0.0.0). Several specialists in Mayan archaeology have written papers advancing various possible correlations between the Long Count and the Julian Day Number. Dates for the zero point range from approximately 3400 B.C. to approximately 2600 B.C. InterCal permits the user to select from among several published correlations, or to specify his/her own.
7) Given a zero point correlation, (that is, given the Julian Day Number corresponding to 0.0.0.0.0.0.0.0), converting between Julian Day numbers and Long Count dates is a trivial problem of converting a decimal number (the Julian Day) to/from a number in another base. That is, to convert a Long Count to a Julian Day simply convert the vigesimal number into decimal, then add day0Mayan, where day0Mayan is the Julian Day of 0.0.0.0.0.0.0.0. The reverse conversion is equally simple.
The Haab Cycle
The Haab cycle approximates the solar year, but is thought of as a cycle rather than a progression. That is, there is no year associated with a Haab date, just as there is no increasing count associated with our seven-day week. This calendar contained 18 months of 20 days each. At the end of the last month came an unlucky period of five days which belonged to no month. Thus the Haab is an ever-repeating cycle of 365 days.
The rules for the Haab calendar are as follows:
1) The months, in order, are: (The Guatemalan Maya orthography is used,
as recommended in the Jenkins article.)
Pohp (Mat)
Wo (??)
Sip (??)
Sotz’ (Bat)
Sek (??)
Xul (Dog)
Yaxk’in (New Sun)
Mol (Water)
Ch’en (Black ??)
Yax (Green ??)
Zak (White ??)
Keh (Red ??)
Mak (??)
K’ank’in (??)
Muwan (Owl)
Pax (??)
K’ayab (Turtle)
Kumk’u (??)
2) The unlucky five day period is called Wayeb.
3) Days in the months are numbered starting at 0, not 1. So the 20 days are numbered 0 through 19 inclusive.
4) InterCal treats Wayeb as a nineteenth month having five days numbered 0 through 4.
5) Archaeologists are confident that they know the day in the Haab cycle corresponding to Long Count 0.0.0.0.0—it is 8 Kumk’u. Thus it is possible to convert Julian Day numbers into Haab cycle dates once you have agreed on a correlation between Julian Days and the Long Count. Similarly, it is possible to find the (infinite) set of all Julian Days corresponding to a given Haab date. The conversions amount to simple arithmetic modulo 365 and modulo 20. The Reingold, Dershowitz, and Clamen paper gives the algorithms in detail, so I will not repeat them here.
The Tzolkin Cycle
In one way the Tzolkin cycle is similar to the Haab cycle. That is, it is not a progression, so there is no increasing count associated with it. However, the Tzolkin calendar (also called the sacred calendar) contained two interacting cycles within itself. Twenty day names continually cycle, and at the same time 13 numbers cycle. Thus the Tzolkin is an ever-repeating cycle of 20•13 = 260 days. To illustrate, 1 Imix is followed by 2 Ik’ is followed by 3 Ak’bal, etc. After 13 Ben comes 1 Ix and then 2 Men, etc. After 260 days all combinations of numbers and names have occurred exactly once, and the cycle starts over. The fact that the Tzolkin cycle existed and had so much religious significance says a lot about the importance of the planet Venus to the Maya. They followed its motions closely, and knew that the average length of time Venus spends as the “Evening Star” before moving to the other side of the sun (as seen from Earth) to become the “Morning Star” is 260 days. Similarly, the average time spent as the “Morning Star” is 260 days.
The rules for the Tzolkin Calendar are as follows:
1) The day names (using the Guatemalan orthography again) are:
Imix (Water lily)
Ik’ (Wind)
Ak’bal (Night)
K’an (Corn)
Chikchan (Snake)
Kimi (Death head)
Manik’ (Hand)
Lamat (Venus)
Muluk (Water)
Ok (Dog)
Chuwen (Frog)
Eb (Skull)
Ben (Cornstalk)
Ix (Jaguar)
Men (Eagle)
Kib (Shell)
Kaban (Earth)
Etz’nab (Flint)
Kawak (Storm cloud)
Ahaw (Lord)
2) The numbers cycle from 1 to 13 inclusive. 0 is not used.
3) Archaeologists are confident that they know the day in the Tzolkin cycle corresponding to Long Count 0.0.0.0.0—it is 4 Ahaw. Thus it is possible to convert Julian Day numbers into Tzolkin cycle dates once you have agreed on a correlation between Julian Days and the Long Count. Similarly, it is possible to find the (infinite) set of all Julian Days corresponding to a given Tzolkin date. Because the day number and day names cycle simultaneously the formulas are a little more complicated than for the Haab cycle. They involve the simultaneous solution of two linear congruences (“equations” in modular arithmetic). The conversion from Julian Day to Tzolkin date gives a unique solution. The conversion in the other direction has an infinite number of solutions separated by the cycle length of 260 days. The Reingold, Dershowitz, and Clamen paper gives the algorithms in detail, so I will not repeat them here.
The Calendar Round
The Haab and Tzolkin dates were often used together to form a compound date. Because the Haab cycle contains 365 days and the Tzolkin cycle contains 260 days, you might think that there are 365•260 = 94900 combinations possible. But 365 and 260 have one common divisor, 5. Therefore after 94900/5 = 18980 days, both Haab and Tzolkin calendars have completed an integral number of cycles. So after 18980 days the pattern of Tzolkin and Haab pairs repeats. Four-fifths of the theoretically possible Haab-Tzolkin combinations never occur. 18980 days is about 12 1/2 days short of 52 tropical years and exactly 52•365. This long cycle is known as the Calendar Round. The completion of a cycle was the cause for ceremonies of major religious significance. The Aztecs, who shared many features of a common Mesoamerican culture with the Maya, are believed by some to have sacrificed tens of thousands of human victims at the last such ceremony held before the Conquest.
Rules for the Calendar Round:
1) The set of all valid Haab-Tzolkin pairs can be determined from the fact that 4 Ahaw 8 Kumk’u is known to be the Calendar Round date corresponding to a Long Count of 0.0.0.0.0.
2) Given an agreed-upon correlation between Julian Days and the Long Count, a Julian Day number can be uniquely converted into a Calendar Round date. Given a valid Calendar Round date, the infinite set of Julian Days corresponding to that date can be determined. The solutions are separated by the length of the cycle, 18980 days. The derivation of the equations is complicated, but once they have been derived the calculation of solutions is very simple. Both the derivations and the final formulas are found in the Reingold, Dershowitz, and Clamen paper, and are not repeated here. An attempt to convert an invalid Calendar Round date (an impossible Haab-Tzolkin combination) results in congruences which have no solution. InterCal senses when that occurs and puts up an Alert screen. Details are in the Users’ Guide.